package com.bryantkobe.myspringcode.exception;

import java.time.Instant;

/**
 * @description: 成功响应记录类
 * @author: alienwarezzl
 * @date: 2025/9/22
 */
public record SuccessResult<T>(int status,String message,T data,
                               String timestamp,long processingTime)
        implements ResponseResult{

    public SuccessResult {
        timestamp = Instant.now().toString();
    }

    public static <T> SuccessResult<T> of(T data){
        return new SuccessResult<>(200,"Success",data,
                Instant.now().toString(),0);
    }
}
